<!-- 联系电话控件 -->
<template>
  <a-space direction="vertical" style="width: 100%">
    <a-input v-model="mobile" :placeholder="props.props.placeholder" />
  </a-space>
</template>

<script lang="ts" setup>
  import { ref, computed, watch, onMounted } from 'vue';
  import miiter from '@/utils/mitt';

  const props = withDefaults(
    defineProps<{
      props: { [propName: string]: any };
      name?: string;
      required?: boolean;
      oneValue: any;
      regex?: {
        [name: string]: {
          role: any;
          name: any;
        };
      };
    }>(),
    {}
  );

  const emit = defineEmits(['update:oneValue']);

  const mobile = computed({
    get: () => {
      return props.oneValue;
    },
    set: (val) => {
      emit('update:oneValue', val);
    },
  });

  miiter.on('buyerInfo', (val: any) => {
    mobile.value = val.data[0].mobile;
    emit('update:oneValue', val.data[0].mobil);
  });

  // const
</script>

<style scoped lang="less"></style>
